home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / B5LSTF (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.2 KB  |  29 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import java.awt.Component;
  5. import java.awt.Graphics;
  6. import java.io.Serializable;
  7.  
  8. public class MetalComboBoxIcon implements Icon, Serializable {
  9.    public int getIconHeight() {
  10.       return 5;
  11.    }
  12.  
  13.    public int getIconWidth() {
  14.       return 10;
  15.    }
  16.  
  17.    public void paintIcon(Component c, Graphics g, int x, int y) {
  18.       int iconWidth = this.getIconWidth();
  19.       g.translate(x, y);
  20.       g.setColor(MetalLookAndFeel.getControlInfo());
  21.       g.drawLine(0, 0, iconWidth - 1, 0);
  22.       g.drawLine(1, 1, 1 + (iconWidth - 3), 1);
  23.       g.drawLine(2, 2, 2 + (iconWidth - 5), 2);
  24.       g.drawLine(3, 3, 3 + (iconWidth - 7), 3);
  25.       g.drawLine(4, 4, 4 + (iconWidth - 9), 4);
  26.       g.translate(-x, -y);
  27.    }
  28. }
  29.